package usi.ch.onto.yago;

public class FactExtractor {
	private String factName;
	private int extractorType;

	public FactExtractor(String factName, int extractorType) {
		this.factName = factName;
		this.extractorType = extractorType;
	}

	public String getFactName() {
		return this.factName;
	}

	public int getExtractorType() {
		return this.extractorType;
	}


	public String getFileName(){
		return FactExtractor.getExtractorFileName(this.extractorType);
	}
	
	public static String getExtractorFileName(int type) {
		String name = "";
		switch (type) {
		case 0:
			name = "ArticleExtractor.txt";
			break;
		case 1:
			name = "CheckedFactExtractor.txt";
			break;
		case 2:
			name = "IsAExtractor.txt";
			break;
		case 5:
			name = "WordNetLinks.txt";
			break;
		case 6:
			name = "ConceptLinker.txt";			
		default:
			name = "ArticleExtractor.txt";
			break;
		}

		return name;
	}

	public static ExtractorType getExtractorType(int extractorType) {
		ExtractorType ret;
		switch (extractorType) {
		case 0:
			ret = ExtractorType.ArticleExtractor;
			break;
		case 1:
			ret = ExtractorType.CheckedFactExtractor;
			break;
		case 2:
			ret = ExtractorType.IsAExtractor;
			break;
		case 5:
			ret = ExtractorType.WordNetLinks;
			break;
		case 6:
			ret = ExtractorType.ConceptLinker;
			break;			
		default:
			ret = ExtractorType.ArticleExtractor;
			break;
		}
		return ret;
	}
	
	public static short getExtractorTypeValue(ExtractorType extractorTypeVal) {
		short ret = 0;
		switch (extractorTypeVal) {
		case ArticleExtractor:
			ret = 0;
			break;
		case CheckedFactExtractor:
			ret = 1;
			break;
		case IsAExtractor:
			ret = 2;
			break;
		case WordNetLinks:
			ret = 5;
			break;
		case ConceptLinker:
			ret = 6;
			break;			
		default:
			ret = 0;
			break;
		}
		return ret;
	}	
}
